package com.common.project.exception;

import com.common.project.common.StatusCode;

/**
 * @ClassName ErrorCode
 * @Description
 * @Author jiangshicun@bicai365.com
 * @Date 2019/6/20 13:56
 */
public enum ErrorCode implements StatusCode {
    P_COMMON_ERROR("P_COMMON_ERROR", "参数校验错误"),
    B_UNAUTHORIZED_ERROR("B_UNAUTHORIZED_ERROR", "未授权"),
    B_NEED_LOGIN_ERROR("B_NEED_LOGIN_ERROR", "需要登陆"),
    B_USER_NOT_FOUND_ERROR("B_USER_NOT_FOUND_ERROR", "非法请求,无法获取到用户信息"),
    B_VALIDATE_CODE_CHECK_ERROR("B_VALIDATE_CODE_CHECK_ERROR", "验证码检查失败"),
    B_DATA_IS_NOT_FOUND_ERROR("B_DATA_IS_NOT_FOUND_ERROR", "数据不存在"),
    B_OPERATION_ERROR("B_OPERATION_ERROR", "操作失败"),
    S_METHOD_NOT_ALLOWED("S_METHOD_NOT_ALLOWED", "资源类型错误GET/POST/DELETE/PUT"),
    S_RESOURCES_NOT_FOUND("S_RESOURCES_NOT_FOUND", "资源未找到"),
    S_SERVICE_UNAVAILABLE("S_SERVICE_UNAVAILABLE", "服务不可用"),
    S_MICRO_SERVICE_ERROR("S_MICRO_SERVICE_ERROR", "内部服务不可用"),
    S_REPEATED_REQUESTS("S_REPEATED_REQUESTS", "重复请求");

    private String errCode;
    private String errMessage;

    private ErrorCode(String errCode, String errMessage) {
        this.errCode = errCode;
        this.errMessage = errMessage;
    }
    @Override
    public String getCode() {
        return this.errCode;
    }
    @Override
    public String getMessage() {
        return this.errMessage;
    }
}
